﻿using DAL.Comm;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class SystemUserDAL
    {
        private SqlCommand cmd;
        public SystemUserDAL()
        {
            cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
        }
        /// <summary>
        /// 用户登录实现
        /// </summary>
        public bool UserLogin(string UserID, string Password)
        {
            cmd.CommandText = "UserLogin";
            cmd.Parameters.Clear();
            cmd.Parameters.Add("UserID", SqlDbType.NVarChar, 6).Value = UserID;
            cmd.Parameters.Add("Password", SqlDbType.NVarChar, 6).Value = Password;
            int num;
            try
            {
                num = (int)SQLHelper.GetScalar(cmd);
                if (num > 0)
                    return true;
                else return false;
            }
            catch //(Exception ex)
            {
                return false;
            }
        }
    }
}
